package com.example.designModel.agency.agency03;

import java.io.Console;
import java.util.regex.Pattern;

/**
 * XXXXXXXXX
 *
 * @author brad zhang
 * @version 2.0
 * @date 2021/11/17 16:27
 */
public class Program {

    private static Pattern pattern = Pattern.compile("[-]?[0-9]+(\\.[0-9]+)?");

    public static void main(String[] args) {
        String s = "-11111";
        System.out.println(pattern.matcher(s).matches());

        System.out.println(Double.parseDouble(s));

        // SchoolGirl jiaojiao = new SchoolGirl();
        // jiaojiao.NameP = "李娇娇";
        // Proxy daili = new Proxy(jiaojiao);
        // daili.GiveDolls();
        // daili.GiveFlowers();
        // daili.GiveChocolate();
    }
}

//送礼物
interface GiveGift {

    void GiveDolls();

    void GiveFlowers();

    void GiveChocolate();
}

class Proxy implements GiveGift {

    Pursuit gg;

    public Proxy(SchoolGirl mm) {
        gg = new Pursuit(mm);
    }

    public void GiveDolls() {
        gg.GiveDolls();
    }

    public void GiveFlowers() {
        gg.GiveFlowers();
    }

    public void GiveChocolate() {
        gg.GiveChocolate();
    }
}

class Pursuit implements GiveGift {

    SchoolGirl mm;

    public Pursuit(SchoolGirl mm) {
        this.mm = mm;
    }

    public void GiveDolls() {
        System.out.println(mm.NameP + " 送你洋娃娃");
    }

    public void GiveFlowers() {
        System.out.println(mm.NameP + " 送你鲜花");
    }

    public void GiveChocolate() {
        System.out.println(mm.NameP + " 送你巧克力");
    }
}

class SchoolGirl {

    private String name;
    public String NameP;

    public String getNameP() {
        return name;
    }

    public void setNameP(String nameP) {
        name = nameP;
    }
}
